<?php
include("include/config.inc.php");
$partyType = $_REQUEST['partyType'];
if(!isset($_SESSION['s_activId']))
{
  $_SESSION['s_urlRedirectDir'] = $_SERVER['REQUEST_URI'];
  header("Location:checkLogin.php");
}

if($partyType != 'All')
{
  $partyTypeCall = "WHERE partyType = '".$partyType."'";
}
$partyNameArray = array();
$i = 0;
$selectQuery = "SELECT partyId,partyName,partyType
                  FROM party
                  ".$partyTypeCall."
              ORDER BY partyName";
$queryRes = mysql_query($selectQuery);
while($partyRow = mysql_fetch_array($queryRes))
{
  $partyNameArray['partyId'][$i]   = $partyRow['partyId'];
  $partyNameArray['partyType'][$i] = $partyRow['partyType'];
  $partyNameArray['partyName'][$i] = $partyRow['partyName'];
  $i++;
}

include("./bottom.php");
$smarty->assign('partyNameArray',$partyNameArray);
$smarty->display('getParty.tpl');
?>